<template>
  <div v-if="activity">
    <h2>{{ activity.title }}</h2>
    <p>日期：{{ activity.date }}</p>
    <p>地点：{{ activity.location }}</p>
    <p>描述：{{ activity.description }}</p>
  </div>
</template>

<script>
import activities from '@/data/activities.json'

export default {
  props: ['id'],
  computed: {
    activity() {
      return activities.find(a => a.id === parseInt(this.id))
    }
  }
}
</script>